const express = require('express')
const app = express()

app.use(express.static('./node_modules'))
app.use(express.static('./public'))
app.set('view engine', 'ejs')
app.set('views', './views')

// 引入cors解决跨域
const cors = require('cors')
app.use(cors())

//加载收藏图标模块
const favicon = require('serve-favicon')
app.use(favicon(__dirname + '/public/favicon.ico'))

// 导入路由模块
const router = require('./router/router')
app.use(router)

app.listen(8081, () => {
   console.log('外卖后台启动成功....')
})